package com.jmodata.zxu.controller.manager;

import com.jmodata.zxu.model.DataGrid;
import com.jmodata.zxu.model.Json;
import com.jmodata.zxu.model.PageHelper;
import com.jmodata.zxu.pojo.manager.LoginLog;
import com.jmodata.zxu.service.manager.LoginLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("loginLog")
public class LoginLogController {

	@Autowired(required = false)
	private LoginLogService loginLogService;

	@RequestMapping("")
	public String loginlog() {
		return "loginLog/loginLog";
	}


	public String add(HttpServletRequest request) {
		return null;
	}

	public String update(HttpServletRequest request) {
		return null;
	}

	public Json delete(HttpServletRequest request) throws Exception {
		return null;
	}

	public Json updateSave(HttpServletRequest request, LoginLog obj)
			throws Exception {
		return null;
	}

	public Json addSave(HttpServletRequest request, LoginLog obj)
			throws Exception {
		return null;
	}

	@RequestMapping("list")
	@ResponseBody
	public DataGrid list(HttpServletRequest request, PageHelper page,
						 LoginLog obj) throws Exception {
		Map<Object, Object> map=new HashMap<Object, Object>();
		map.put("rows", page.getRows());
		map.put("start", page.getStart());
		map.put("startTime", request.getParameter("startTime"));
		map.put("endTime", request.getParameter("endTime"));
		map.put("name", request.getParameter("name"));
		return loginLogService.loginLogList(map);
	}

}
